package com.jxaummd.mushroom.main.common.data;

import com.blankj.utilcode.util.LogUtils;
import com.jxaummd.mushroom.core.app.application.University;
import com.jxaummd.mushroom.core.base.data.CommonBackModel;
import com.jxaummd.mushroom.core.base.data.DataSource;
import com.jxaummd.mushroom.core.util.net.RestClient;

public class SendCodeData {

    /**
     * 发送
     * 验证码
     */
    public static void sendRegeisterCode(String phonenumber, DataSource.Callback callback) {
//        RestClient.builder()
//                .url(University.getApiHost() + "University/sendIdentifyingCodeForRegister")
//                .params("phoneNumber", phonenumber)
//                .success(response -> {
//                    LogUtils.d(response);
//                    CommonBackModel commonBackModel = CommonBackModel.parseInstance(response);
//                    callback.onDataLoaded(commonBackModel);
//                })
//                .error((code, msg) -> {
//                    LogUtils.d(code+msg);
//                    CommonBackModel commonBackModel = CommonBackModel.parseInstance(msg);
//                    callback.onDataLoaded(commonBackModel);
//                })
//                .build()
//                .get();
    }

    /**
     * 发送
     * 验证码
     */
    public static void sendForgetPasswordCode(String phonenumber, DataSource.Callback callback) {
//        RestClient.builder()
//                .url(University.getApiHost() + "University/sendIdentifyingCodeForRetrievePassword")
//                .params("phoneNumber", phonenumber)
//                .success(response -> {
//                    CommonBackModel commonBackModel = CommonBackModel.parseInstance(response);
//                    callback.onDataLoaded(commonBackModel);
//                })
//                .error((code, msg) -> {
//                    CommonBackModel commonBackModel = CommonBackModel.parseInstance(msg);
//                    callback.onDataLoaded(commonBackModel);
//                })
//                .build()
//                .get();
    }
}
